runOnStartup(async runtime => {
    runtime.objects.AVA.addEventListener("instancecreate", (e) => {
        lib.Action_Jump_ShowAva.InitAction()
        runtime.addEventListener("tick", () => {
            var AvA = runtime.objects.AVA.getFirstInstance() == null
            if (AvA == null) {
                return
            }

            lib.Action_Jump_ShowAva.PLinTaget()
        })
    })
})
lib.Action_Jump_ShowAva = {
    InitAction: function () {
        var AvA = runtime.objects.AVA.getFirstInstance()
        if (AvA == null) {
            return
        }
        AvA.zElevation = 500

    },

    PLinTaget: function () {
        var tag = runtime.objects.avaTarge?.getFirstInstance()
        var pl = runtime.objects.Pl?.getFirstInstance()
        var AvA = runtime.objects.AVA?.getFirstInstance()
        if (tag == null || AvA == null || pl == null) {
            return;
        }
        tag.isVisible = false
        AvA.isVisible = false
        if (tag == null) {
            return
        }

        if (pl.testOverlap(tag)) {
            var TagTimes = tag.instVars.times
            if (TagTimes <= 0) {
                tag.instVars.times += 1
                AvA.zElevation = 0

            }
        }
    }
}